#ifndef WXSSIZER_H
#define WXSSIZER_H

#include "wxsparent.h"
#include "wxsflags.h"

#include <prep.h>

using namespace wxsFlags;


class wxsSizerExtra: public wxsPropertyContainer {
  public:
    long Proportion;                ///< \brief Proportion param (see wxW documentation for details)
    long Flags;                     ///< \brief Sizer item flags
    wxsDimensionData Border;        ///< \brief Size of additional border
    wxsSizeData MinSize;            ///< \brief Minimal size

    wxsSizerExtra():
      Proportion( 1 ),
      Flags( wxsSizerFlagsProperty::AlignCenterHorizontal |
             wxsSizerFlagsProperty::AlignCenterVertical |
             wxsSizerFlagsProperty::BorderTop |
             wxsSizerFlagsProperty::BorderBottom |
             wxsSizerFlagsProperty::BorderLeft |
             wxsSizerFlagsProperty::BorderRight ) {
      ConfigManager* cfg = Manager::Get()->GetConfigManager( _T( "wxsmith" ) );
      Proportion         = cfg->ReadInt( _T( "/defsizer/proportion" ), Proportion );
      Flags              = cfg->ReadInt( _T( "/defsizer/flags" ),      Flags );
      Border.Value       = cfg->ReadInt( _T( "/defsizer/border" ),     5 );
      Border.DialogUnits = cfg->ReadBool( _T( "/defsizer/borderdu" ),   false );
    }

    wxString AllParamsCode( wxsCoderContext* Ctx );

  protected:

    virtual void OnEnumProperties( long Flags );
};



class wxsSizer: public wxsParent {
  public:


    wxsSizer( wxsItemResData* Data, const wxsItemInfo* Info );

  protected:


    virtual wxSizer* OnBuildSizerPreview( wxWindow* Parent ) = 0;


    virtual void OnBuildSizerCreatingCode() = 0;


    virtual void OnEnumSizerProperties( long Flags ) = 0;


    virtual void OnAddSizerQPP( M_Code_unused wxsAdvQPP* QPP ) {}

  private:


    virtual long OnGetPropertiesFlags();


    virtual void OnBuildCreatingCode();


    virtual void OnBuildDeclarationsCode();



    wxObject* OnBuildPreview( wxWindow* Parent, long Flags );


    virtual wxsPropertyContainer* OnBuildExtra();


    virtual void OnAddChildQPP( wxsItem* Child, wxsAdvQPP* QPP );


    virtual bool OnXmlReadChild( TiXmlElement* Elem, bool IsXRC, bool IsExtra );


    virtual bool OnXmlWriteChild( int Index, TiXmlElement* Elem, bool IsXRC, bool IsExtra );


    virtual wxString OnXmlGetExtraObjectClass();


    virtual void OnEnumItemProperties( long Flags );


    virtual void OnAddItemQPP( wxsAdvQPP* QPP );

};

#endif
